//
// Maths.hpp for  in /home/goldbe_y//tek3/Projets/Maths/302graphe
// 
// Made by yoni goldberg
// Login   <goldbe_y@epitech.net>
// 
// Started on  Mon Sep 24 14:38:25 2012 yoni goldberg
// Last update Sun Oct 28 16:02:14 2012 yoni goldberg
//

#ifndef MATHS
#define MATHS

#include "Parse.hpp"
#include <cstdlib>
#include "convert.hpp"

class Maths
{
public:
  Maths(const std::string &);
  ~Maths();


private: // Vars
  // From Parse
  int		_dim;
  float		**_matrix;
  float		*_vecteur;
  float		**_save_m;
  float		*_save_v;

  // From Maths
  float		*_rep;
  
private: // Funcs

  void		monte();
  void		descente();

  float		calc(int);

  void		pivot();
  bool		is_direct();
  void		swap_column();
  void		aff_matrix();

  void		div(int, float);
  void		sub(int, int , float);

  void		mult_matrix();

};

template<typename T>
void		swap(T *a, T *b)
{
  T temp;

  temp = *a;
  *a = *b;
  *b = temp;
}

#endif
